/**
 * Created by renzhiqiang on 17/5/30.
 */
var url=require("url");
function slice(arg) {
    if(arg.indexOf('cadillac')>-1){
        return 'cadillac'
    } else {
        return '';
    }
}
module.exports = function (sreq) {
   var url_parts=url.parse(sreq.url);
   var opt  = {};
   switch (slice(sreq.url)) {
       case 'cadillac' : {
           opt ={
               host:"shop.op.myxiaoqi.com",
               port:'8003',
               method:sreq.method,
               path:url_parts.path.replace('/cadillac/','/'),
               headers:sreq.headers
           };
           break ;
       }
       default : {
           opt ={
               host:"localhost",
               port:63343,
               method:sreq.method,
               path: '/admin-system-front/' +url_parts.pathname,
               headers:sreq.headers
           };
           break ;
       }
   }
   return opt;
};
